package com.ksl.kinglockguard.widget.common;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.ksl.kinglockguard.R;

public class CommonDialog extends Dialog {
		private Button btnYes;
		private Button btnNo;
		private TextView tvDialogTips;
		
		public CommonDialog(Context context) {
			super(context, R.style.lock_dialog);
			setContentView(R.layout.lock_yes_or_no_dialog);
			btnYes = (Button) findViewById(R.id.btn_yes);
			btnNo = (Button) findViewById(R.id.btn_no);
			tvDialogTips = (TextView) findViewById(R.id.tv_dialog_tips);
			
			this.setCanceledOnTouchOutside(false);
		}
		
		public void setConfirmListener(View.OnClickListener onclick) {
			btnYes.setOnClickListener(onclick);
		}
		
		public void setCancelListener(View.OnClickListener onclick) {
			btnNo.setOnClickListener(onclick);
		}
		
		public void setDialogTips(String tips){
			tvDialogTips.setText(tips);
		}
		
		public void setDialogTips(int resId){
			tvDialogTips.setText(resId);
		}
}
